<?php

class Order_EditController extends Crb_Controller
{
	function preDispatch()
	{
		parent::preDispatch();
		$this->view->layout()->setLayout('admin');
	}
	
	
	
	public function indexAction()
	{
		
	}
	
	
	public function deleteAction()
	{
	    $this->disableLayout();
	    $this->setNoRender();
	    $id = $this->_getParam('id');
	    $orderDAO = new Order();
	    $orderDAO->cancel($id);
	    $this->_redirect('order/edit');
	}
	
	
    public function removeAction()
    {
        $this->setNoRender();
        $this->disableLayout();
        
        $ID  = $this->_request->getParam('id',0);
        $IDS = $this->_request->getParam('ids',array());
        
        $orderDAO = new Order();
        
        $orderDAO->cancel($ID);
        
        foreach ($IDS as $currentID)
        {
            $orderDAO->cancel($currentID);
        }
    }
}

